import { findHeadCategory } from '@/api/home'

export default {
  namespaced: true,
  state () {
    return {
      navList: []
    }
  },
  mutations: {
    updateNav (state, payload) {
      state.navList = payload
    }
  },
  actions: {
    async getNavList ({ commit }, payload) {
      const { result: res } = await findHeadCategory()
      console.log(res)
      commit('updateNav', res)
    }
  }
}
